define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'group.conf/index',
        add_url: 'group.conf/add',
        edit_url: 'group.conf/edit',
        delete_url: 'group.conf/delete',
        export_url: 'group.conf/export',
        modify_url: 'group.conf/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {width: 120, field: 'group_purchase', title: '是否开启社区团购'},
                    {width: 100,field: 'announcement', title: '公告'},
                    {width: 80,field: 'stop_start_time', title: '休市开始时间'},
                    {width: 80,field: 'stop_end_time', title: '休市结束时间'},
                    {width: 100,field: 'reg_apply_image',minWidth: 80, title: '团长申请海报',search: false, templet: ea.table.image},


                    // {field: 'image', minWidth: 80, title: '分类图片', search: false, templet: ea.table.image},
                    {width: 100,field: 'stop_image', title: '休市海报'},
                    {width: 100,field: 'sup_apply_image', title: '供应商申请海报'},
                    {width: 100,field: 'send_mode', title: '发货方式'},
                    {width: 100,field: 'custom_master', title: '自定义团长名称'},
                    {width: 100,field: 'master_range', title: '团长覆盖范围'},
                    {width: 100,field: 'withdrawal_fee', title: '提现手续费'},
                    {width: 100,field: 'min_with_fee', title: '最低提现金额'},
                    {width: 100,field: 'master_commission', title: '团长佣金'},
                    {width: 100,field: 'create_time', title: '创建时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});